# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  
  # Pick a unique cookie name to distinguish our session data from others'
  include SimpleCaptcha::ControllerHelpers
  include AuthenticatedSystem
  
  session :session_key => '_login_session_id'
  
  layout "layout"
  
  private
    def authorize
      unless User.find_by_id(session[:user_id])
        flash[:notice] = "Please log in"
        redirect_to new_session_url 
      end
    end
    
    
end
